<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="jiraStore" styleClass="edit">

        <rich:panel>
            <f:facet name="header">#{jiraStoreHome.managed ? 'Edit' : 'Add'} Jira store</f:facet>

  <s:decorate id="descriptionField" template="layout/edit.xhtml">
                <ui:define name="label">Description</ui:define>
                <h:inputTextarea id="description"
                               cols="80"
                               rows="3"
                              value="#{jiraStoreHome.instance.description}"/>
            </s:decorate>


            <s:decorate id="labelField" template="layout/edit.xhtml">
                <ui:define name="label">Label</ui:define>
                <h:inputTextarea id="label"
                               cols="80"
                               rows="3"
                              value="#{jiraStoreHome.instance.label}"/>
            </s:decorate>


            <s:decorate id="requiredField" template="layout/edit.xhtml">
                <ui:define name="label">Required</ui:define>
                <h:selectBooleanCheckbox id="required"
                                   required="true"
                                      value="#{jiraStoreHome.instance.required}"/>
            </s:decorate>



            <s:decorate id="projectKeyField" template="layout/edit.xhtml">
                <ui:define name="label">Project Key</ui:define>
                <h:inputTextarea id="projectKey"
                               cols="80"
                               rows="3"
                              value="#{jiraStoreHome.instance.projectKey}"/>
            </s:decorate>
            
            <s:decorate id="serviceUrlField" template="layout/edit.xhtml">
                <ui:define name="label">Service URL</ui:define>
                <h:inputTextarea id="serviceUrl"
                               cols="80"
                               rows="3"
                              value="#{jiraStoreHome.instance.serviceUrl}"/>
            </s:decorate>

            <div style="clear:both">
                <span class="required">*</span>
                required fields
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Save"
                         action="#{jiraStoreHome.persist}"
                       disabled="#{!jiraStoreHome.wired}"
                       rendered="#{!jiraStoreHome.managed}"/>

            <h:commandButton id="update"
                          value="Save"
                         action="#{jiraStoreHome.update}"
                       rendered="#{jiraStoreHome.managed}"/>

            <h:commandButton id="delete"
                          value="Delete"
                         action="#{jiraStoreHome.remove}"
                      immediate="true"
                       rendered="#{jiraStoreHome.managed}"/>

            <s:button id="cancelEdit"
                   value="Cancel"
             propagation="end"
                    view="/JiraStore.xhtml"
                rendered="#{jiraStoreHome.managed}"/>

            <s:button id="cancelAdd"
                   value="Cancel"
             propagation="end"
                    view="/#{empty jiraStoreFrom ? 'WorkStoreList' : jiraStoreFrom}.xhtml"
                rendered="#{!jiraStoreHome.managed}"/>

        </div>
    </h:form>

</ui:define>

</ui:composition>
